// 本地存储

// 存
export const setItem = (key: string, value: any) => {
  window.sessionStorage.setItem(key, JSON.stringify(value))
}

// 取
export const getItem = (key: string) => {
  const value = window.sessionStorage.getItem(key)
  if (value) {
    return JSON.parse(value)
  }
}

// 删
export const removeItem = (key: string) => {
  window.sessionStorage.removeItem(key)
}

// 删全部
export const clearItem = () => {
  window.sessionStorage.clear()
}
